<?php

	class User_network_model extends CI_Model {

		protected $__tbname = 'user_network';
		protected $__dbconf = 'default';

		var $id;	//bigint(20) unsigned	Primary Key	Auto Increment	NOT NULL
		var $id_user;	//bigint(20) unsigned			NOT NULL
		var $id_network;	//tinyint(3) unsigned			NOT NULL
		var $uid;	//varchar(50)			NULL
		var $access_token;	//varchar(100)			NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'bigint', 'null' => FALSE, 'auto_increment' => TRUE),
			'id_user' => array('key' => 'MUL', 'type' => 'bigint', 'null' => FALSE),
			'id_network' => array('type' => 'tinyint', 'null' => FALSE),
			'uid' => array('type' => 'varchar', 'size' => 50, 'null' => TRUE),
			'access_token' => array('type' => 'varchar', 'size' => 100, 'null' => TRUE)
		);

		protected $__relation = array(
			array('table' => 'user', 'foreign_key' => 'id_user'),
			array('table' => 'network', 'foreign_key' => 'id_network')
		);
	}
